<%-- 
    Document   : quartoDetalhe
    Created on : 31/10/2010, 13:55:49
    Author     : renan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%>

<f:view>
    <h:form id="DEQuarto" enctype="multipart/form-data">
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <link rel="stylesheet" type="text/css" href="../../css/style.css">
                <script type="text/javascript" src="../../js/funcoes.js"></script>
                <title>Cadastro de Quartos</title>
            </head>
            <body onload="foco();">
                <table width="100%">
                    <tr>
                        <td align="left">
                            <a4j:commandButton id="btInserir"  image="../../imagens/salvar.png" action="#{quartoFrm.gravar}"
                                               title="Gravar novo registro" onmouseover="mouseSobre(this);" onmouseout="mouseSai(this);"
                                               onmousedown="mouseClicou(this);" onmouseup="mouseDesclicou(this);"
                                               reRender="ncamas,valorDiaria,nPessoas,situacao,foto,erros"/>
                            <a4j:status>
                                <f:facet name="start">
                                    <h:graphicImage value="../../imagens/ajax-loader.gif"/>
                                </f:facet>
                            </a4j:status>
                        </td>
                        <td align="right">
                            <a4j:commandButton image="../../imagens/sair.png" action="#{quartoFrm.fechar}"
                                               title="Fechar" onmouseover="mouseSobre(this);" onmouseout="mouseSai(this);"
                                               onmousedown="mouseClicou(this);" onmouseup="mouseDesclicou(this);"/>
                        </td>
                    </tr>
                </table>
                <table width="100%" align="center">
                    <tr>
                        <td>
                            <rich:panel id="painelCadastro" styleClass="tituloTabela">
                                <f:facet name="header">
                                    <h:outputText value="Cadastro de Quartos"></h:outputText>
                                </f:facet>
                                <h:panelGrid columns="1" styleClass="rotulo">
                                    <h:column><h:outputText styleClass="rotulo" value="Nº Camas:"/></h:column>
                                    <h:column><h:inputText id ="ncamas" onkeydown="mascara(this,numero);" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);" size="50" maxlength="100" value="#{quartoFrm.quarto.quarto.nCamas}"/></h:column>
                                    <h:column><h:outputText styleClass="rotulo" value="Valor da Diária:"/></h:column>
                                    <h:column><h:inputText id="valorDiaria" size="50" maxlength="6" onkeydown="mascara(this,valor)" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{quartoFrm.quarto.quarto.valorDiaria}"/></h:column>
                                    <h:column><h:outputText styleClass="rotulo" value="Nº Pessoas"/></h:column>
                                    <h:column><h:inputText id="nPessoas" size="50" maxlength="2" onkeydown="mascara(this,numero)" onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);"  value="#{quartoFrm.quarto.quarto.nPessoas}"/></h:column>
                                    <h:column><h:outputText styleClass="rotulo" value="Situação:"/></h:column>
                                    <h:column>
                                        <h:selectOneMenu id="situacao" value="#{quartoFrm.quarto.quarto.situacao}" styleClass="campo"
                                                         onfocus="ganhouFoco(this);" onblur="perdeuFoco(this);">
                                            <f:selectItems value="#{quartoFrm.situacao}"/>
                                        </h:selectOneMenu>
                                    </h:column>
                                    <h:column><h:outputText styleClass="rotulo" value="Foto:"/></h:column>
                            <rich:fileUpload fileUploadListener="#{quartoFrm.upload}"
                                          addControlLabel="Procurar" clearControlLabel="Limpar" maxFilesQuantity="1"  id="upload" immediateUpload="true" acceptedTypes="jpg,jpeg"
                                          />
                        </h:panelGrid>
                    </rich:panel>
                    <!-- AREA DE MENSAGENS -->
                    <h:panelGroup id="erros">
                        <rich:messages globalOnly="true" layout="table" styleClass="textoErro">
                            <f:facet name="errorMarker">
                                <h:graphicImage value="../../imagens/important.png"/>
                            </f:facet>
                        </rich:messages>
                    </h:panelGroup>
                </td>
            </tr>
        </table>
    </body>
</html>
</h:form>
<script type="text/javascript">
    function foco() {
        el('DEUsuario:nome').focus();
    }
</script>
</f:view>
